import { Component, Injector, ViewChild, Input } from '@angular/core';
import { AppComponentBase } from '@shared/common/app-component-base';
import { EstimatedCategoryCostDto } from '@shared/service-proxies/service-proxies';
import { ModalDirective } from 'ngx-bootstrap';

@Component({
    selector: 'typeCostDetailModal',
    templateUrl: './type-cost-detail-modal.component.html'
})
export class TypeCostDetailModalComponent extends AppComponentBase {
    totalAmount = 100;

    costs = new Array<EstimatedCategoryCostDto>();

    @ViewChild('modal') modal: ModalDirective;

    constructor(injector: Injector) {
        super(injector);
    }

    show(totalAmount: number, costs: Array<EstimatedCategoryCostDto>): void {
        this.totalAmount = totalAmount;
        this.costs = costs;
        this.modal.show();
    }

    close(): void {
        this.modal.hide();
    }
}
